<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
		<style>
			.cont{
				margin-top:44px;
			}
			.cont{
				width: 100%;
			}
			.imgtext{
				height: 240px;
				border: 1px solid red;
			}
			.imgtext .pic{
				height: 240px;
			}
			.imgtext img{
				width: 100%;
				height: 100%;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">详情信息</h1>
		</header>
		<div class="cont">
			<div class="imgtext">
				<div class="pic">
					<img src="imgs/01.jpg" class="tu"/>
				</div>
			</div>
			<div id="data">
				<!-- <p>
					<span>公司名称</span>
					<span>"iuyaeg"</span>
				</p>
				<p>
					<span>联系人</span>
					<span>"iuyaeg"</span>
				</p>
				<p>
					<span>电话</span>
					<span>122222222</span>
				</p>
				<p>
					<span>需求详情</span>
					<span>需要大量招工的人</span>
				</p> -->
			</div>
		</div>
		
		
		
		<script src="js/mui.js"></script>
		<script type="text/javascript">
			var a=mui.init();
		</script>
	</body>

</html>
<script>
	function getUrlParam (name) {
	     var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");  
	     var r = window.location.search.substr(1).match(reg);  
	     if (r!= null) {  
	        return unescape(r[2]);  
	     }else{  
	        return null;  
	     }  
	}    
window.onload=function(){
	
	 
	//获取url中的targetId参数  
	var targetId = getUrlParam('id');  
	console.log(targetId);
	// mui.plusReady(function() {  
	//                 var value = plus.webview.currentWebview();  
	// 				console.log(value)
	//             });
	mui.ajax('http://140.143.206.157:5000/api/v1/company/'+targetId,{
		
		dataType:'json',//服务器返回json格式数据
		type:'get',//HTTP请求类型
		timeout:10000,//超时时间设置为10秒；
		headers:{'Content-Type':'application/json'},	              
		success:function(data){
			var data=data.info;
			let {company_name,linkman,phone,need}=data;
			var arr=[company_name,linkman,phone,need]
			var st="";
			st+="<p></p>";
			st+="<span>公司名称</span>"
			st+="<span>"+company_name+"</span>"
			st+="<p></p>"
			st+="<p></p>";
			st+="<span>联系人</span>"
			st+="<span>"+linkman+"</span>"
			st+="<p></p>"
			st+="<p></p>";
			st+="<span>联系电话</span>"
			st+="<span>"+phone+"</span>"
			st+="<p></p>"
			st+="<p></p>";
			st+="<span>需求详情</span>"
			st+="<span>"+need+"</span>"
			st+="<p></p>"
			// var frag=document.createDocumentFragment();
			mui("#data")[0].innerHTML=st
			
		},
		error:function(xhr,type,errorThrown){
			//异常处理；
			console.log(type);
		}
	});
}
</script>
